package myPetStore.web.servlet;

import myPetStore.domain.Account;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

public class SignOnEmailFormServlet extends HttpServlet {
    private static final String  SIGN_ON_EMAIL_FORM="/WEB-INF/jsp/account/signonbyemail.jsp";

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Account tempAccount=new Account();
        tempAccount.setEmail("");
        HttpSession session=req.getSession();
        session.setAttribute("tempAccount",tempAccount);
        session.setAttribute("token","");
        req.getRequestDispatcher(SIGN_ON_EMAIL_FORM).forward(req,resp);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req, resp);
    }
}
